//
//  H_HoneyAnniversaryViewController.m
//  Honey
//
//  Created by 贾亚涵 on 16/4/9.
//  Copyright © 2016年 贾亚涵. All rights reserved.
//

#import "H_HoneyAnniversaryViewController.h"
#import "H_HoneyAddAnniVersaryVC.h"

@interface H_HoneyAnniversaryViewController ()
{
    UIImageView * _centerBarIV;
    UILabel * _BarLabel;
}

@end

@implementation H_HoneyAnniversaryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor cyanColor];
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self infoNavigationBarBtn];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    [_BarLabel removeFromSuperview];
    
    [_centerBarIV removeFromSuperview];
}


-(void)infoNavigationBarBtn
{
    _centerBarIV = [[UIImageView alloc] initWithFrame:CGRectMake(50, 10, 1, 20)];
    _centerBarIV.backgroundColor = [UIColor blackColor];
    _centerBarIV.alpha = 0.2f;
    [self.navigationController.navigationBar addSubview:_centerBarIV];
    
    _BarLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_centerBarIV.frame)+14, 10, 100, 20)];
    _BarLabel.text = @"纪念日";
    _BarLabel.textColor = [UIColor whiteColor];
    [self.navigationController.navigationBar addSubview:_BarLabel];
    
    UIImage * rightBtnImage = [[UIImage imageNamed:@"honey_add2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:rightBtnImage style:UIBarButtonItemStylePlain  target:self action:@selector(RightBarBtnClicked:)];
}     

-(void)RightBarBtnClicked:(id)sender
{
    H_HoneyAddAnniVersaryVC * _AAVVC = [H_HoneyAddAnniVersaryVC new];
    
    [self.navigationController pushViewController:_AAVVC animated:YES];
}
@end
